package com.globallogic.javatraining.liudmyla_shapoval.uni.resources;

import java.util.ArrayList;
import java.util.List;

public class University {

	private ArrayList<Course> coursesList = new ArrayList<Course>();

	public University() {

	}

	public List<Course> getAllCourses() {
		return coursesList;
	}

	public void addCourse(Course course) {
		coursesList.add(course);
		course.setId();
	}

	public void dropCourse(Course course) {
		if (!course.hasEnrollments())	{
			coursesList.remove(course);
		}	
	}

}
